<%@page import="java.util.ArrayList"%>
<%@ page import="co.edu.uniandes.entregAndes.fachada.EntregAndesAdmin"%>
<%@ page import="co.edu.uniandes.entregAndes.dao.ConsultaDAOCatalogo"%>

<%
	EntregAndesAdmin ent = EntregAndesAdmin.darInstancia();
%>
<%
	ConsultaDAOCatalogo dao = ent.darDao();
%>
<%
	ArrayList<String[]> lol = dao.consultarVehiculos();
%>
<!DOCTYPE html>
<html>
<%@ include file="../_header.jsp"%>
<body>
	<%@ include file="../_nav.jsp"%>

	<div class="row-fluid">
		<div class="col-md-3"></div>
		<div class="col-md-9">
			<h3>Lista de Veh&iacute;culos</h3>
			<%
				if (lol.isEmpty()) {
			%>
			<p>No se encontraron resultados</p>
			<%
				} else {
			%>
			<%
				if (lol.get((lol.size() - 1)).length == 1) {
			%>
			<%= lol.get((lol.size() - 1))[0] %>
			<%
				} else {
			%>
			<table width=100%>
				<thead>
					<tr>
						<th>Placa</th>
						<th>Tipo</th>
						<th>Estado</th>
					</tr>
				</thead>
				<tbody>
					<%
						for (String[] s : lol) {
					%>
					<tr>
						<td><%=s[0]%></td>
						<td><%=s[1]%></td>
						<td><%=s[2]%></td>
					</tr>
					<%
						}
					%>
				</tbody>
			</table>
			<%
				}
			%>
			<% } %>
		</div>
	</div>

</body>
</html>